#ifndef IMPORTDATADIALOG_H
#define IMPORTDATADIALOG_H

#include <QDialog>
#include <QMessageBox>
#include <ui_importdatadialog.h>
#include <data/gsdata.h>
#include <QThread>

//The Max Import File Size (M)
#define FILEMAXSIZE 500000

class ImportDataDialog : public QDialog
{
    Q_OBJECT
    Q_ENUMS(InFileType)
public:
    enum InFileType { GSPP, TEXT, MATLAB, ITPP};
//    InFileType inFileType; // import file type

public:
    explicit ImportDataDialog(GSData* inData, QWidget *parent = 0);
    ~ImportDataDialog();

    QString filePath();
    ImportDataDialog::InFileType fileFormat();
    QString dataName();
    GSData::DataType dataType();
    QString dataComments();
    QString getSplits();

    bool importTextFile();
    bool importGsppFile();

private slots:
    void editFilePathClicked();
    void preViewButtonClicked();
    void okButtonClicked();
    void cancelButtonClicked() { reject(); }
    void updateProcess();
    void fileFormatChange(int index);

private:
    Ui::ImportDataDialogUi ui;
    int process;
    qint32 allFileLines;
    qint32 currentLines;
    QTimer* timer = NULL; //update process bar
    QTime* time = NULL;
    GSData* inData = NULL; //copy from mainwindow, not delete
};




#endif // IMPORTDATADIALOG_H
